import request from "@/utils/request";

//  图书列表
export function booksList(data) {
  return request({
    url: "/virlib-admin/ctrl/query",
    method: "post",
    data,
  });
}

// 导入图书
export function importBooks(data) {
  return request({
    url: "/virlib-admin/ctrl/file",
    method: "put",
    data,
  });
}

// 新建图书
export function addBooks(data) {
  return request({
    url: "/virlib-admin/ctrl",
    method: "put",
    data,
  });
}

// 修改图书
export function editBooks(data) {
  return request({
    url: "/virlib-admin/ctrl",
    method: "post",
    data,
  });
}

// 删除图书
export function deleteBooks(ctrlId) {
  return request({
    url: `/virlib-admin/ctrl/${ctrlId}`,
    method: "delete",
  });
}

//  资产列表
export function assetsList(data) {
  return request({
    url: "/virlib-admin/asset/query",
    method: "post",
    data,
  });
}

// 资产集合
export function assetsArr(ctrlId) {
  return request({
    url: `/virlib-admin/asset/${ctrlId}`,
    method: "get",
  });
}

// 导入资产
export function importAssets(data) {
  return request({
    url: "/virlib-admin/asset/file",
    method: "put",
    data,
  });
}

// 新建资产
export function addAssets(data) {
  return request({
    url: "/virlib-admin/asset",
    method: "put",
    data,
  });
}

// 修改资产
export function editAssets(data) {
  return request({
    url: "/virlib-admin/asset",
    method: "post",
    data,
  });
}

// 删除资产
export function deleteAssets(assetId) {
  return request({
    url: `/virlib-admin/asset/${assetId}`,
    method: "delete",
  });
}
